//
//  OrderDetViewController.m
//  YaDiuDiu
//
//  Created by 欧洪飞 on 2017/8/23.
//  Copyright © 2017年 jy. All rights reserved.
//

#import "OrderDetViewController.h"

@interface OrderDetViewController ()<UITableViewDelegate,UITableViewDataSource>{
    NSArray *array1;
    NSArray *array2;
}

@property (nonatomic,strong)UITableView *tableView;

@end

@implementation OrderDetViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = COLOR_RGB(242, 242, 242, 1);
    
    array1 = @[@"类型",@"房源名称",@"用途",@"支出",@"支付方式",@"时间"];
    array2 = @[@"租房",@"渝北万科精装单间家电齐全\n拎包入住",@"查看房源联系方式",@"1.00元",@"支付宝",@"2017-06-05 14:30:21"];
    [self showNav:@"交易详情"];
    [self loadUI];
    
}

- (void)loadUI{
    _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 64, ScreenWidth, 44*5+65) style:UITableViewStylePlain];
    _tableView.delegate = self;
    _tableView.dataSource = self;
    _tableView.scrollEnabled = NO;
    //去分割线
    //_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    [self.view addSubview:_tableView];
    
}

#pragma -mark UITableViewDataSource
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 6;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString *cellId = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellId];
    }
    
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    
    cell.textLabel.text = array1[indexPath.row];
    cell.textLabel.textColor = COLOR_RGB(128, 128, 128, 1);
    cell.textLabel.font = [UIFont systemFontOfSize:15.0];
    
    
    cell.detailTextLabel.text = array2[indexPath.row];
    cell.detailTextLabel.textColor = COLOR_RGB(38, 38, 38, 1);
    cell.detailTextLabel.font = [UIFont systemFontOfSize:15.0];
    
    
    return cell;
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    if (indexPath.row == 1) {
        return 60.0;
    }
    return 44.0;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
